function main( json ) {
/*
  if ( json == null ){
        var ex = "{ exception: { message: 'no param provided'} }";
        return ex;
  }
 */
  var filteredTransactions = getFilteredTransactions();
  
  var result = new JSONObject();
  
return filteredTransactions;
}



function getFilteredTransactions() {
  
  var records = new JSONArray();
 
 var cmd = "select t from TransactionEntity t where t.userAgent = 'MIVR'";
  
    EntityManager.find(  
    cmd,  
    null,
     function(result) {
      
      for( var i = 0; i < result.size() ; ++i ) {
        
        records.put( JSONObject.wrap(result.get(i)) );
      }
      
    });
    
    var result = new JSONObject();
    
    result.put( "records", records );
    
    return records ;

}


